package com.wl.application.controller;

import com.alibaba.nacos.api.exception.NacosException;
import org.springframework.amqp.core.Queue;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.context.annotation.Bean;
import org.springframework.web.bind.annotation.*;

import java.util.Map;

/**
 * @author wl
 * @version 1.0
 * @date 2022/7/21
 * @description:
 */
@RestController
@RequestMapping("/server2")
public class ProviderController {

    public static  int a=1;
    @GetMapping("/test")
    public String serverText(){
        return "server服务2:::"+System.currentTimeMillis();
    }
    @PostMapping("/timeout")
    public String timeout() throws InterruptedException {
        if (a==1) {
            Thread.sleep(2900);
            a=0;
        }

        return "休眠结束了";
    }
}
